package json;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

class Cate {
	int catecount;
	int cateid;
	String catename;

	public void setCateCount(int catecount) {
		this.catecount = catecount;
	}

	public int getCateCount() {
		return this.catecount;
	}

	public void setCateId(int cateid) {
		this.cateid = cateid;
	}

	public int getCateId() {
		return this.cateid;
	}

	public void setCateName(String catename) {
		this.catename = catename;
	}

	public String getCateName() {
		return this.catename;
	}
}

class CCity {
	int citycount;
	int cityid;
	String cityname;

	public void setCityCount(int citycount) {
		this.citycount = citycount;
	}

	public int getCityCount() {
		return this.citycount;
	}

	public void setCityId(int cityid) {
		this.cityid = cityid;
	}

	public int getCityId() {
		return this.cityid;
	}

	public void setCityName(String cityname) {
		this.cityname = cityname;
	}

	public String getCityName() {
		return this.cityname;
	}
}

public class Json_SearchModel {
	private static final String TAG = "Json_SearchModel";
	private List<Json_Company> listCompany;
	private List<Cate> listCate;
	private List<CCity> listCity;

	public List<Json_Company> getListCompany() {
		return listCompany;
	}

	public void setListCompany(List<Json_Company> listCompany) {
		this.listCompany = listCompany;
	}

	public List<Cate> getListCate() {
		return listCate;
	}

	public void setListCate(List<Cate> listCate) {
		this.listCate = listCate;
	}

	public List<Json_Sort> getSorts() {
		if (listCate == null)
			return null;

		List<Json_Sort> sorts = new ArrayList<Json_Sort>();
		try {
			for (Cate map : listCate) {
				Json_Sort sort = new Json_Sort();
				sort.setChildNums(map.getCateCount());
				sort.setId(map.getCateId());
				sort.setName(map.getCateName());

				sorts.add(sort);
			}

			return sorts;
		} catch (Exception e) {
			// LogUtil.ex(TAG, "", e);
			return null;
		}
	}

	public List<CCity> getListCity() {
		return listCity;
	}

	public void setListCity(List<CCity> listCity) {
		this.listCity = listCity;
	}

	public List<Json_City> getCities() {
		if (listCate == null)
			return null;

		List<Json_City> cities = new ArrayList<Json_City>();
		try {
			for (CCity map : listCity) {
				Json_City city = new Json_City();
				city.setChildNums(map.getCityCount());
				city.setId(map.getCityId());
				city.setName(map.getCityName());

				cities.add(city);
			}

			return cities;
		} catch (Exception e) {
			// LogUtil.ex(TAG, "", e);
			return null;
		}
	}
}